<?php
	  $tags_deal = get_deal_tags($this);
      $deal_link = BUZZR_URL.'/deal/'.$this->get_field('camp_link');
      $ext_link = $this->get_field('extlink');
      $deal_title = substr($this->get_field('name'),0,150);
      $original_price = $this->get_field('oriprice');
      $discount = $this->get_field('disper');
      $new_price = $this->get_field('disprice');
      $deal_details = strip_tags($this->get_field('short'));
      $cat_name = $this->get_field('camp_cat.name');
      $cat_slug = $this->get_field('camp_cat.url');
      $cat_link = BUZZR_URL.'/'.$cat_slug;
      $cat_class = $cat_slug;
      if(empty($cat_class)){
        $cat_class = 'uncategorized';
      }
      $deal_expires = $this->get_field('camp_end');

      $merchant_name = ucwords($this->get_field('brand.name'));
      $merchant = 'Merchant: <a href="'.BUZZR_URL.'/brands/'.$this->get_field('brand.brandurl').'">'.$merchant_name.'</a>';
      
      $provider_name = ucwords($this->get_field('deal_provider.name'));
      $provider = 'By: <a href="'.BUZZR_URL.'/brands/'.$this->get_field('deal_provider.brandurl').'">'.$provider_name.'</a>';
      
      if(empty($provider_name)){
        $provider_name = ucwords($this->get_field('added_by_user.name'));
        $provider = 'By: <a href="'.BUZZR_URL.'/member/'.$this->get_field('added_by_user.slug').'">'.$provider_name.'</a>';
      }
      $deal_detail = $this->get_field('short').'<br /><br /><br />Visit: <a href="'.$deal_link.'" title="'.$deal_name.'" >'.$merchant_name.'</a> deal';
     $image = get_image($this);
     $deal_link_ga = get_redirect($this);      
  ?> 
        <li class="<?php echo $cat_class; ?>">
            <div class="deal">
              <div class="deal_list_images">
                <div class="images">
        
               <?php if($image != TRUE){ ?>
	                <a href="<?php echo $deal_link_ga; ?>" target="_blank"><div class="image_filler"><p><?php echo $merchant_name;?></p></div></a>
	                <?php }else{ ?>
	               	 <a href="<?php echo $deal_link_ga; ?>" target="_blank"><img src="<?php echo $image; ?>" alt="<?php echo $tags_deal; ?>" /></a>
	               	 <?php } ?>
             
                <div class="icon">
                	<?php if(!empty($discount)){?>
                	<span class="discount"><?php echo $discount.'% off'; ?></span>
                	<img src="<?php echo BUZZR_THEME_URL.'/img/discount.png'; ?>" width="70px" height="70px">
                	<?php }?>
                </div>
                </div>
              </div>
              <div class="deal_list_details">
                <p class="deal_title"><a href="<?php echo $deal_link_ga; ?>" target="_blank"><?php echo $deal_title; ?></a></p>
                <div class="get_deal">
                	<a href="<?php echo $deal_link_ga; ?>" target="_blank"><img src="<?php echo BUZZR_THEME_URL.'/img/grab.png'; ?>"/></a>
	                <?php /* if (!empty($deal_expires)){?> <p class="expiry">Expires In: <?php echo $deal_expires;  ?></p><?php } */ ?> 
	                <?php if(!empty($discount)){?>
	                <p class="discount_daily"><?php echo $discount.'% off'; ?></p>
	                <?php } ?>
	                <?php if((!empty($original_price)) && (!empty($new_price))){ ?>
	                <div class="prices_daily">
	                <table cellpadding="0" cellspacing="0" border="0">
		           			<tr class="price_table">
		           				<td>Original Price:</td>
		           				<td><?php echo 'Rs.'.$original_price; ?></td>
		           			</tr>
		           			<tr class="price_table">
		           				<td>You Pay:</td>
		           				<td><?php echo 'Rs.'.$new_price; ?></td>
		           			</tr>
		           		</table>
	                
	                </div>
	                <?php } ?>
                    <div class="clear"></div> 
                </div>  
              <?php  /* <div class="details"><?php  echo $deal_detail; ?></div> */ ?>
                 
                       
             </div>
             <div class="clear"></div>
             <div class="deal_info">
             	<div class="info" >
             	<?php if(!empty($merchant_name)){?> <span class="info_name"><?php echo $merchant; ?></span><?php }?>
                <?php if(!empty($provider_name)){?><span class="info_name"><?php echo $provider; ?></span><?php }?>
	            </div>
	            <div class="social">
	            	<div class="google"><g:plusone size="small" href="<?php echo $deal_link; ?>"></g:plusone></div>
	            	<div class="fb"><iframe src="http://www.facebook.com/plugins/like.php?app_id=228219050523496&amp;href=<?php echo $deal_link; ?>&amp;send=false&amp;layout=button_count&amp;width=300&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:21px;" allowTransparency="true"></iframe></div>
	            	<div class="clear"></div>
	            </div>
	         </div>
             <div class="clear"></div>
            </div>
            
        </li>